local money = 0

local function HUDPaint()
if (SERVER) then return end

	local ply = LocalPlayer()
	
	surface.CreateFont( "coolvetica", 16, 500, true, false, "text" )
	
	if ( !ValidEntity( ply ) ) then return end

local hptxt=surface.GetTextureID("moneymod/hp")
local montxt=surface.GetTextureID("moneymod/money")

	surface.SetDrawColor(255,255, 255, 255)
	surface.DrawRect(0, 0, ScrW(), 16)


surface.SetTexture(hptxt)
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(0,0,16,16)

surface.SetTexture(montxt)
surface.SetDrawColor(255,255,255,255)
surface.DrawTexturedRect(120,0,16,16)
	
	
	
	local colortouse = Color(40, 40, 40, 255)

//	if (ply:GetNetworkedInt("money") != nill) then
//		money = ply:GetNetworkedInt("money")
//	end	

	draw.DrawText("Cash: $" .. money, "text", 136, 0, colortouse, TEXT_ALIGN_LEFT)
	draw.DrawText("HP: " .. ply:Health(), "text", 16, 0, colortouse, TEXT_ALIGN_LEFT)
	local datetime = os.date("%H:%M:%S - %d/%m/%Y")
	draw.DrawText("Time: " .. tostring(datetime), "text", 300, 0, colortouse, TEXT_ALIGN_LEFT)
end

function UpdateHud(ply, cmd,args)
	money = tonumber(args[1])
end
concommand.add("updatemoney",updatehud)

hook.Add( "HUDPaint", "MoneyMod.HUDPaint", HUDPaint )
